home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / iconal1a / searchfo.frm < prev    next >
Text File  |  1999-10-04  |  4KB  |  141 lines

  1. VERSION 4.00
  2. Begin VB.Form SearchForm 
  3.    Caption         =   "Search Icons"
  4.    ClientHeight    =   3570
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1515
  7.    ClientWidth     =   4755
  8.    Height          =   3975
  9.    Icon            =   "SearchForm.frx":0000
  10.    Left            =   1080
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   238
  15.    ScaleMode       =   3  'Pixel
  16.    ScaleWidth      =   317
  17.    Top             =   1170
  18.    Width           =   4875
  19.    Begin VB.CommandButton Command1 
  20.       Caption         =   "COPY"
  21.       Height          =   420
  22.       Left            =   3645
  23.       TabIndex        =   3
  24.       Top             =   1125
  25.       Width           =   870
  26.    End
  27.    Begin VB.FileListBox File1 
  28.       BackColor       =   &H00C0FFC0&
  29.       ForeColor       =   &H00008000&
  30.       Height          =   2985
  31.       Left            =   1845
  32.       Pattern         =   "*.ico"
  33.       TabIndex        =   2
  34.       Top             =   495
  35.       Width           =   1500
  36.    End
  37.    Begin VB.DirListBox Dir1 
  38.       BackColor       =   &H00C0FFC0&
  39.       ForeColor       =   &H00008000&
  40.       Height          =   2505
  41.       Left            =   135
  42.       TabIndex        =   1
  43.       Top             =   990
  44.       Width           =   1545
  45.    End
  46.    Begin VB.DriveListBox Drive1 
  47.       BackColor       =   &H00C0FFC0&
  48.       ForeColor       =   &H00008000&
  49.       Height          =   315
  50.       Left            =   135
  51.       TabIndex        =   0
  52.       Top             =   495
  53.       Width           =   1545
  54.    End
  55.    Begin VB.Label Label1 
  56.       BackColor       =   &H00C0FFC0&
  57.       BorderStyle     =   1  'Fixed Single
  58.       Caption         =   "Label1"
  59.       ForeColor       =   &H000000FF&
  60.       Height          =   285
  61.       Left            =   135
  62.       TabIndex        =   4
  63.       Top             =   45
  64.       Width           =   4470
  65.    End
  66.    Begin VB.Image Image1 
  67.       Height          =   480
  68.       Left            =   3825
  69.       Top             =   540
  70.       Width           =   480
  71.    End
  72. End
  73. Attribute VB_Name = "SearchForm"
  74. Attribute VB_Creatable = False
  75. Attribute VB_Exposed = False
  76. Private Sub Command1_Click() 'copy to temp
  77. On Error GoTo mkdir0
  78. MkDir IBpath$ & "\" & "_tempicons"
  79. IconBook.Dir1.Refresh
  80. mkdir0:
  81. FileCopy Label1.Caption, IBpath & "\" & "_tempicons" & "\" & File1.List(File1.ListIndex)
  82. Command1.Enabled = False
  83. IconBook.File1.Refresh
  84. End Sub
  85.  
  86. Private Sub Dir1_Change()
  87. File1.Path = Dir1.Path
  88. Label1.Caption = Dir1.Path
  89. CopyEnabled
  90. End Sub
  91.  
  92. Private Sub Dir1_Click()
  93. File1.Path = Dir1.List(Dir1.ListIndex)
  94. Label1.Caption = Dir1.List(Dir1.ListIndex)
  95. CopyEnabled
  96. End Sub
  97.  
  98. Private Sub Drive1_Change()
  99. Dir1.Path = Drive1.Drive
  100. Label1.Caption = Drive1.Drive
  101. CopyEnabled
  102. End Sub
  103.  
  104. Private Sub File1_Click()
  105. If Right(File1.Path, 1) = "\" Then
  106. Image1.Picture = LoadPicture(File1.Path + File1.List(File1.ListIndex))
  107. Label1.Caption = File1.Path + File1.List(File1.ListIndex)
  108. Else
  109. Image1.Picture = LoadPicture(File1.Path + "\" + File1.List(File1.ListIndex))
  110. Label1.Caption = File1.Path + "\" + File1.List(File1.ListIndex)
  111. End If
  112. CopyEnabled
  113. End Sub
  114.  
  115. Private Sub Form_Activate()
  116. Command1.Enabled = False
  117. End Sub
  118.  
  119. Private Sub Form_Load()
  120. SearchForm.Move (Screen.Width - SearchForm.Width) / 2, (Screen.Height - SearchForm.Height) / 2
  121. Drive1.Drive = "c:"
  122. Dir1.Path = "c:\"
  123. File1.Path = "c:\"
  124. Label1.Caption = ""
  125. End Sub
  126.  
  127. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  128. Cancel = True
  129. SearchForm.Hide
  130. IconBook.Show
  131. End Sub
  132.  
  133. Private Sub CopyEnabled()
  134. If File1.ListIndex = -1 Then
  135. Command1.Enabled = False
  136. Image1.Picture = LoadPicture("")
  137. Else
  138. Command1.Enabled = True
  139. End If
  140. End Sub
  141.